import { Module } from '@nestjs/common';
import { AdminService } from './admin.service';
import { AdminController } from './admin.controller';
import { DatabaseModule } from 'src/common/database/database.module';
import { adminUserProviders } from './admin.providers';
import { JwtModule } from '@nestjs/jwt';
import { JwtAdminStrategy } from './guard/jwt.strategy';
import { UploadController } from './upload/api.controller';
import { ZiliaoModule } from './ziliao/ziliao.module';
import { EmploymentModule } from './employment/employment.module';
import { BianhuantuModule } from './bianhuantu/bianhuantu.module';
import { ShipinleibieModule } from './shipinleibie/shipinleibie.module';
import { YingshishipinModule } from './yingshishipin/yingshishipin.module';
import { YingpingfankuiModule } from './yingpingfankui/yingpingfankui.module';

const jwtModule = JwtModule.register({
  secret: '加密Admin',
  signOptions: { expiresIn: '7d' },
});

@Module({
  imports: [DatabaseModule, jwtModule, ZiliaoModule, EmploymentModule, BianhuantuModule, ShipinleibieModule, YingshishipinModule, YingpingfankuiModule],
  controllers: [AdminController, UploadController],
  providers: [...adminUserProviders, AdminService, JwtAdminStrategy],
})
export class AdminModule {}
